<section class="content-header">
    <h1>
        编码规则
    </h1>
    <ol class="breadcrumb">
        <li><a ui-sref="dashboard"><i class="fa fa-dashboard"></i>我的面板</a></li>
        <li><a class="active">编码规则</a></li>
    </ol>
</section>
<section class="content">
    <form class="form-horizontal" id="coding_form">
        <div class="box box-danger">
            <div class="box-header with-border">
                <h3 class="box-title">区域代码</h3>
            </div>
            <div class="box-body">
                <div class="form-group">
                    <label class="col-sm-2 control-label">流水号</label>
                    <div class="col-sm-3">
                        <input type="number" class="form-control" name="suffix1" ng-model="data.customer.suffix" data-rule="required; integer[+]; range[4~8]">
                    </div>
                    <label class="control-label">位数</label>
                </div>
                <div class="form-group" ng-repeat="item in data.customer.area_code">
                    <div class="col-sm-2">
                        <input type="text" class="form-control" ng-model="item.name" readonly style="background:#fff;">
                    </div>
                    <div class="col-sm-3">
                        <input type="text" class="form-control" name="area_code{{$index}}" ng-model="item.value" data-rule="required; length[2~4]" placeholder="区域代码">
                    </div>
                    <label class="control-label" ng-bind="getExample(data.customer.suffix, item.value)"></label>
                </div>
            </div>
        </div>
        <div class="box box-danger">
            <div class="box-header with-border">
                <h3 class="box-title">档案号编号规则</h3>
            </div>
            <div class="box-body">
                <div class="form-group">
                    <label class="col-sm-2 control-label">流水号</label>
                    <div class="col-sm-3">
                        <input type="number" class="form-control" name="suffix2" ng-model="data.order.suffix" data-rule="required; integer[+]; range[4~8]">
                    </div>
                    <label class="control-label">位数</label>
                </div>
                <div class="form-group" ng-repeat="item in data.order.code">
                    <div class="col-sm-2">
                        <input type="text" class="form-control" ng-model="item.module_name" readonly style="background:#fff;">
                    </div>
                    <div class="col-sm-3">
                        <input type="text" class="form-control" name="area_code{{$index}}" ng-model="item.value" data-rule="required; length[2~4]" placeholder="业务代码">
                    </div>
                    <label class="control-label" ng-bind="getExample(data.order.suffix, item.value)"></label>
                </div>
            </div>
        </div>
        <div class="box-footer clearfix">
            <a class="btn btn-sm btn-info btn-flat pull-left" ng-click="save()">保存</a>
        </div>
    </form>
</section>
